package com.android.example.viewexample;

import android.app.Activity;
import android.os.Bundle;
import android.view.WindowManager;
import android.view.Window;

public class ViewExample extends Activity
{
	MainView mainview;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		mainview = new MainView(this);
		mainview.Initialize();
        setContentView(mainview);
        // setContentView(R.layout.main);
    }
	
	@Override
	public void onBackPressed(){
		super.onBackPressed();
		mainview.Destroy();
		mainview = null;
		ViewExample.this.finish();
	}
	@Override
	public void onStop(){
		super.onStop();
		//danh.ngothanh: override to stop app when press home
		mainview.Destroy();
		mainview = null;
		ViewExample.this.finish();
	}
}
